<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
    .col-sm-offset-2{
        margin-left: 0!important;
    }
</style>
<div class="main-content">
    <div class="box box-main">
        <form id="inputForm" model="post" action="<c:url value="/web/admin/organization/saveChildPage.action"/>"
              method="post" class="form-horizontal">
            <div class="box-body">
                <div class="form-unit">基本信息</div>
                <input name="id" value="${organization.id}" type="hidden">
                <input name="parentId" value="${parentId}" type="hidden">
                <div class="row">
                    <c:if test="${organization.id!=null}">
                        <div class="col-xs-12">
                            <div class="form-group">
                                <label class="control-label col-sm-4" title="">
                                    组织ID：<i class="fa icon-question hide"></i></label>
                                <div class="col-sm-8">
                                    <span>${organization.id}</span>
                                </div>
                            </div>
                        </div>
                    </c:if>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 组织名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="organizationName" name="organizationName" value="${organization.organizationName}"
                                       class="form-control required"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 组织描述：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="organizationDesc"  name="organizationDesc" value="${organization.organizationDesc}"
                                       class="form-control required"/>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#inputForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                // console.log(data);
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                    $("#addOrEditId").val("");
                    tree();
                }
            }, "json");
        }
    });

    function closeView() {
        layer.close(LayWin['wAddChildOrganization']);
    }
</script>


